<template>
    <transition 
    :name="pageTransition" 
    
    >
      <keep-alive>
          <router-view></router-view>
      </keep-alive>
    </transition>
</template>
<script>
export default {
  components: {},
  data() {
    return {
      transitionName: "fade",
      enterFadeTimeout: false,
    };
  },
  computed: {
    indicator: {
      get() {
        return this.$store.state.indicator;
      },
      set(value) {
        this.$store.commit("SET_INDICATOR", {
          value,
        });
      },
    },
    pageTransition() {
      return this.enterFadeTimeout ? this.$store.state.pageTransition : "null";
    },
  },
  watch: {
    $route(to, from) {},
    indicator(val, oldVal) {
      if (val) {
        this.$dialog.loading.open("加载中");
      } else {
        this.$dialog.loading.close();
      }
    },
  },
  created() {
    setTimeout(() => {
      this.enterFadeTimeout = true;
    }, 1000);
  },
};
</script>
<style>

</style>

